package indi.zhifa.engine.test.dao.dbservice.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import indi.zhifa.engine.mpenhance.ann.ZfDbService;
import indi.zhifa.engine.mpenhance.service.impl.ZfDbServiceImpl;
import indi.zhifa.engine.test.dao.dbservice.IGenUserDbService;
import indi.zhifa.engine.test.dao.mapper.GenUserMapper;
import indi.zhifa.engine.test.entity.po.GenUserEntity;

/**
 * <p>
 * 用户表 服务实现类
 * </p>
 *
 * @author 织法
 * @since 2025-04-08
 */
@ZfDbService(name="GenUserEntity")
public class GenUserDbServiceImpl extends ZfDbServiceImpl<GenUserMapper, GenUserEntity> implements IGenUserDbService {

    @Override
    public boolean existByUserName(String userName) {
        LambdaQueryWrapper<GenUserEntity> queryWrapper = Wrappers.<GenUserEntity>lambdaQuery()
                .eq(GenUserEntity::getUserName, userName);
        return baseMapper.selectCount(queryWrapper) > 0;
    }
}
